package com.luobo.found.bulider;

/**
 * 自定义 创建者
 * @author : AnWen
 * @version :1.0
 * @email : anwen375@qq.com
 * @since : 2020/3/5 9:07
 */
public class MyToyBuilder implements ToyBuilder {

    private Toy toy;

    @Override
    public void init() {
        toy = new Toy();
    }

    @Override
    public void buildHead(String head) {
        toy.setHead(head);
    }

    @Override
    public void buildBody(String body) {
        toy.setBody(body);
    }

    @Override
    public Toy getToy() {
        logic();
        return toy;
    }

    private void logic() {
        toy.setTail("小尾巴...");
    }

}
